package top.foxhome.productimages.productimages;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;
import java.util.Locale;

public class MainApplication extends Application {
    @Override
    public void start(Stage stage) throws IOException {
        Locale locale = Locale.getDefault(); // 或 new Locale("zh", "CN")
        I18N.init(locale);
        FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("hello-view.fxml"));
        fxmlLoader.setResources(I18N.getBundle());
        Scene scene = new Scene(fxmlLoader.load(), 320, 240);
        stage.setTitle(I18N.get("welcome.message"));
        stage.setScene(scene);
        stage.show();
        MainController controller = fxmlLoader.getController();
        controller.initView();
        controller.setOwnerWindow(stage);
    }

    public static void main(String[] args) {
        launch();
    }
}